import React, { Component } from "react";
import { Button } from "antd";

import { HocComp } from "../../HOC/index";
import Hello from "../../components/Hello";

const WithHello = HocComp(Hello);

export default class home extends Component {
  render() {
    /**  history  location  match  三个路由 属性 */
    const {
      history: { push },
    } = this.props;
    /**
     * push, replace 的区别
     *      push：会将操作放到浏览器的历史记录，但是replace则不会
     *      replace：跳转效果看上去像返回两层
     */
    return (
      <div>
        <Button
          type="danger"
          onClick={() => {
            push("/user");
          }}
        >
          {" "}
          跳转到个人中心{" "}
        </Button>
        <WithHello type="hot" cid={17} />
      </div>
    );
  }
}
